﻿using System;
using System.Windows.Data;
using System.Collections.Generic;
using System.Linq;

namespace VisualStudioAchievements
{
    public class FullToSelectConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                List<Achievement> achievements = (List<Achievement>)value;
                List<Achievement> earned = achievements.Take(3).ToList();
                return earned;
            }
            else
                return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
